<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="list.push(999)">添加元素</button>
        <!-- 会产生3个，并且每个h3的内容分别是10 20 30 -->
      <h3 v-for="item in list">{{ item }}</h3>

      <ul>
        <!-- li也有3个 -->
        <li v-for="(item, index) in list">{{ item }} --- {{ index }}</li>
      </ul>


      <ul>
        <!-- 可以改名 -->
        <!-- 第一个一定是每一项，第二个一定是下标 -->
        <li v-for="(v, i) in list">{{ v }} --- {{ i }}</li>
      </ul>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            list: [10, 20, 30]
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
